/*
package com.example.jdk19;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class VirtualThreadExample {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor();
        executor.execute(() -> {
            Thread currentThread = Thread.currentThread();
            System.out.println("Virtual thread started: " + currentThread.getName());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
            System.out.println("Virtual thread finished: " + currentThread.getName());
        });

        executor.execute(() -> {
            Thread currentThread = Thread.currentThread();
            System.out.println("Another virtual thread started: " + currentThread.getName());
            System.out.println("Another virtual thread finished: " + currentThread.getName());
        });

        executor.shutdown();
        try {
            executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
}
*/
